<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="chat_v1.html">Google Chat API</a> . <a href="chat_v1.spaces.html">spaces</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="chat_v1.spaces.members.html">members()</a></code>
</p>
<p class="firstline">Returns the members Resource.</p>

<p class="toc_element">
  <code><a href="chat_v1.spaces.messages.html">messages()</a></code>
</p>
<p class="firstline">Returns the messages Resource.</p>

<p class="toc_element">
  <code><a href="chat_v1.spaces.spaceEvents.html">spaceEvents()</a></code>
</p>
<p class="firstline">Returns the spaceEvents Resource.</p>

<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#completeImport">completeImport(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the specified space and makes it visible to users. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) and domain-wide delegation with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.import` For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/workspace/chat/authorize-import).</p>
<p class="toc_element">
  <code><a href="#create">create(body=None, requestId=None, x__xgafv=None)</a></code></p>
<p class="firstline">Creates a space. Can be used to create a named space, or a group chat in `Import mode`. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.app.spaces.create` - `https://www.googleapis.com/auth/chat.app.spaces` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When authenticating as an app, the `space.customer` field must be set in the request. When authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set `space.permission_settings.manage_apps` to `managers_allowed`. Space membership upon creation depends on whether the space is created in `Import mode`: * **Import mode:** No members are created. * **All other modes:** The calling user is added as a member. This is: * The app itself when using app authentication. * The human user when using user authentication. If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.</p>
<p class="toc_element">
  <code><a href="#delete">delete(name, useAdminAccess=None, x__xgafv=None)</a></code></p>
<p class="firstline">Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and the authorization scope: - `https://www.googleapis.com/auth/chat.app.delete` (only in spaces the app created) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.delete` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and the following authorization scope is used: - `https://www.googleapis.com/auth/chat.admin.delete`</p>
<p class="toc_element">
  <code><a href="#findDirectMessage">findDirectMessage(name=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces`</p>
<p class="toc_element">
  <code><a href="#get">get(name, useAdminAccess=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot` - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator approval](https://support.google.com/a?p=chat-app-auth) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and one of the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - `space.access_settings` is only populated when using the `chat.app.spaces` scope. - `space.predefind_permission_settings` and `space.permission_settings` are only populated when using the `chat.app.spaces` scope, and only for spaces the app created.</p>
<p class="toc_element">
  <code><a href="#list">list(filter=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.</p>
<p class="toc_element">
  <code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#patch">patch(name, body=None, updateMask=None, useAdminAccess=None, x__xgafv=None)</a></code></p>
<p class="firstline">Updates a space. For an example, see [Update a space](https://developers.google.com/workspace/chat/update-spaces). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.app.spaces` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - To update either `space.predefined_permission_settings` or `space.permission_settings`, the app must be the space creator. - Updating the `space.access_settings.audience` is not supported for app authentication.</p>
<p class="toc_element">
  <code><a href="#search">search(orderBy=None, pageSize=None, pageToken=None, query=None, useAdminAccess=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns a list of spaces in a Google Workspace organization based on an administrator's search. In the request, set `use_admin_access` to `true`. For an example, see [Search for and manage spaces](https://developers.google.com/workspace/chat/search-manage-admin). Requires [user authentication with administrator privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) and one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces`</p>
<p class="toc_element">
  <code><a href="#search_next">search_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#setup">setup(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces`</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="completeImport">completeImport(name, body=None, x__xgafv=None)</code>
  <pre>Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the specified space and makes it visible to users. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) and domain-wide delegation with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.import` For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/workspace/chat/authorize-import).

Args:
  name: string, Required. Resource name of the import mode space. Format: `spaces/{space}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for completing the import process for a space.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for completing the import process for a space.
  &quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app. # The import mode space.
    &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
      &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
      &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    },
    &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
    &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
    &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
    &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
    &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
    &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
    &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
    &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
      &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
      &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
    },
    &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
    &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
      &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
    },
    &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
    &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
      &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
      &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
    },
    &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
    &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
    &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
    &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
    &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
    &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="create">create(body=None, requestId=None, x__xgafv=None)</code>
  <pre>Creates a space. Can be used to create a named space, or a group chat in `Import mode`. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.app.spaces.create` - `https://www.googleapis.com/auth/chat.app.spaces` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When authenticating as an app, the `space.customer` field must be set in the request. When authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set `space.permission_settings.manage_apps` to `managers_allowed`. Space membership upon creation depends on whether the space is created in `Import mode`: * **Import mode:** No members are created. * **All other modes:** The calling user is added as a member. This is: * The app itself when using app authentication. * The human user when using user authentication. If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.

Args:
  body: object, The request body.
    The object takes the form of:

{ # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}

  requestId: string, Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}</pre>
</div>

<div class="method">
    <code class="details" id="delete">delete(name, useAdminAccess=None, x__xgafv=None)</code>
  <pre>Deletes a named space. Always performs a cascading delete, which means that the space&#x27;s child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and the authorization scope: - `https://www.googleapis.com/auth/chat.app.delete` (only in spaces the app created) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.delete` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and the following authorization scope is used: - `https://www.googleapis.com/auth/chat.admin.delete`

Args:
  name: string, Required. Resource name of the space to delete. Format: `spaces/{space}` (required)
  useAdminAccess: boolean, Optional. When `true`, the method runs using the user&#x27;s Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.delete` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}</pre>
</div>

<div class="method">
    <code class="details" id="findDirectMessage">findDirectMessage(name=None, x__xgafv=None)</code>
  <pre>Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces`

Args:
  name: string, Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}</pre>
</div>

<div class="method">
    <code class="details" id="get">get(name, useAdminAccess=None, x__xgafv=None)</code>
  <pre>Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot` - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator approval](https://support.google.com/a?p=chat-app-auth) - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and one of the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - `space.access_settings` is only populated when using the `chat.app.spaces` scope. - `space.predefind_permission_settings` and `space.permission_settings` are only populated when using the `chat.app.spaces` scope, and only for spaces the app created.

Args:
  name: string, Required. Resource name of the space, in the form `spaces/{space}`. Format: `spaces/{space}` (required)
  useAdminAccess: boolean, Optional. When `true`, the method runs using the user&#x27;s Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}</pre>
</div>

<div class="method">
    <code class="details" id="list">list(filter=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
  <pre>Lists spaces the caller is a member of. Group chats and DMs aren&#x27;t listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.

Args:
  filter: string, Optional. A query filter. You can filter spaces by the space type ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can&#x27;t be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = &quot;SPACE&quot; spaceType = &quot;GROUP_CHAT&quot; OR spaceType = &quot;DIRECT_MESSAGE&quot; ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.
  pageSize: integer, Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it&#x27;s automatically changed to 1000. Negative values return an `INVALID_ARGUMENT` error.
  pageToken: string, Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response for a list spaces request.
  &quot;nextPageToken&quot;: &quot;A String&quot;, # You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages.
  &quot;spaces&quot;: [ # List of spaces in the requested (or first) page. Note: The `permissionSettings` field is not returned in the Space object for list requests.
    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
      &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
        &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
        &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
      },
      &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
      &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
      &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
      &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
      &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
      &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
      &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
      &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
      &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
        &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
        &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
      },
      &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
      &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
      },
      &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
      &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
      &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
        &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
        &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
      },
      &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
      &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
      &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
      &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
      &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
      &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="list_next">list_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="patch">patch(name, body=None, updateMask=None, useAdminAccess=None, x__xgafv=None)</code>
  <pre>Updates a space. For an example, see [Update a space](https://developers.google.com/workspace/chat/update-spaces). If you&#x27;re updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.app.spaces` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - To update either `space.predefined_permission_settings` or `space.permission_settings`, the app must be the space creator. - Updating the `space.access_settings.audience` is not supported for app authentication.

Args:
  name: string, Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`. (required)
  body: object, The request body.
    The object takes the form of:

{ # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}

  updateMask: string, Required. The updated field paths, comma separated if there are multiple. You can update the following fields for a space: `space_details`: Updates the space&#x27;s description. Supports up to 150 characters. `display_name`: Only supports updating the display name for spaces where `spaceType` field is `SPACE`. If you receive the error message `ALREADY_EXISTS`, try a different value. An existing space within the Google Workspace organization might already use this display name. `space_type`: Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `space_type` in the update mask and ensure that the specified space has a non-empty display name and the `SPACE` space type. Including the `space_type` mask and the `SPACE` type in the specified space when updating the display name is optional if the existing space already has the `SPACE` type. Trying to update the space type in other ways results in an invalid argument error. `space_type` is not supported with `useAdminAccess`. `space_history_state`: Updates [space history settings](https://support.google.com/chat/answer/7664687) by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. `space_history_state` is not supported with `useAdminAccess`. `access_settings.audience`: Updates the [access setting](https://support.google.com/chat/answer/11971020) of who can discover the space, join the space, and preview the messages in named space where `spaceType` field is `SPACE`. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can&#x27;t update this field if the space is in [import mode](https://developers.google.com/workspace/chat/import-data-overview). To learn more, see [Make a space discoverable to specific users](https://developers.google.com/workspace/chat/space-target-audience). `access_settings.audience` is not supported with `useAdminAccess`. `permission_settings`: Supports changing the [permission settings](https://support.google.com/chat/answer/13340792) of a space. When updating permission settings, you can only specify `permissionSettings` field masks; you cannot update other field masks at the same time. `permissionSettings` is not supported with `useAdminAccess`. The supported field masks include: - `permission_settings.manageMembersAndGroups` - `permission_settings.modifySpaceDetails` - `permission_settings.toggleHistory` - `permission_settings.useAtMentionAll` - `permission_settings.manageApps` - `permission_settings.manageWebhooks` - `permission_settings.replyMessages`
  useAdminAccess: boolean, Optional. When `true`, the method runs using the user&#x27;s Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.spaces` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). Some `FieldMask` values are not supported using admin access. For details, see the description of `update_mask`.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}</pre>
</div>

<div class="method">
    <code class="details" id="search">search(orderBy=None, pageSize=None, pageToken=None, query=None, useAdminAccess=None, x__xgafv=None)</code>
  <pre>Returns a list of spaces in a Google Workspace organization based on an administrator&#x27;s search. In the request, set `use_admin_access` to `true`. For an example, see [Search for and manage spaces](https://developers.google.com/workspace/chat/search-manage-admin). Requires [user authentication with administrator privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) and one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces`

Args:
  orderBy: string, Optional. How the list of spaces is ordered. Supported attributes to order by are: - `membership_count.joined_direct_human_user_count` — Denotes the count of human users that have directly joined a space. - `last_active_time` — Denotes the time when last eligible item is added to any topic of this space. - `create_time` — Denotes the time of the space creation. Valid ordering operation values are: - `ASC` for ascending. Default value. - `DESC` for descending. The supported syntax are: - `membership_count.joined_direct_human_user_count DESC` - `membership_count.joined_direct_human_user_count ASC` - `last_active_time DESC` - `last_active_time ASC` - `create_time DESC` - `create_time ASC`
  pageSize: integer, The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it&#x27;s automatically changed to 1000.
  pageToken: string, A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
  query: string, Required. A search query. You can search by using the following parameters: - `create_time` - `customer` - `display_name` - `external_user_allowed` - `last_active_time` - `space_history_state` - `space_type` `create_time` and `last_active_time` accept a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported comparison operators are: `=`, `&lt;`, `&gt;`, `&lt;=`, `&gt;=`. `customer` is required and is used to indicate which customer to fetch spaces from. `customers/my_customer` is the only supported value. `display_name` only accepts the `HAS` (`:`) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space&#x27;s `display_name`. For example, `Fun Eve` matches `Fun event` or `The evening was fun`, but not `notFun event` or `even`. `external_user_allowed` accepts either `true` or `false`. `space_history_state` only accepts values from the [`historyState`] (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) field of a `space` resource. `space_type` is required and the only valid value is `SPACE`. Across different fields, only `AND` operators are supported. A valid example is `space_type = &quot;SPACE&quot; AND display_name:&quot;Hello&quot;` and an invalid example is `space_type = &quot;SPACE&quot; OR display_name:&quot;Hello&quot;`. Among the same field, `space_type` doesn&#x27;t support `AND` or `OR` operators. `display_name`, &#x27;space_history_state&#x27;, and &#x27;external_user_allowed&#x27; only support `OR` operators. `last_active_time` and `create_time` support both `AND` and `OR` operators. `AND` can only be used to represent an interval, such as `last_active_time &lt; &quot;2022-01-01T00:00:00+00:00&quot; AND last_active_time &gt; &quot;2023-01-01T00:00:00+00:00&quot;`. The following example queries are valid: ``` customer = &quot;customers/my_customer&quot; AND space_type = &quot;SPACE&quot; customer = &quot;customers/my_customer&quot; AND space_type = &quot;SPACE&quot; AND display_name:&quot;Hello World&quot; customer = &quot;customers/my_customer&quot; AND space_type = &quot;SPACE&quot; AND (last_active_time &lt; &quot;2020-01-01T00:00:00+00:00&quot; OR last_active_time &gt; &quot;2022-01-01T00:00:00+00:00&quot;) customer = &quot;customers/my_customer&quot; AND space_type = &quot;SPACE&quot; AND (display_name:&quot;Hello World&quot; OR display_name:&quot;Fun event&quot;) AND (last_active_time &gt; &quot;2020-01-01T00:00:00+00:00&quot; AND last_active_time &lt; &quot;2022-01-01T00:00:00+00:00&quot;) customer = &quot;customers/my_customer&quot; AND space_type = &quot;SPACE&quot; AND (create_time &gt; &quot;2019-01-01T00:00:00+00:00&quot; AND create_time &lt; &quot;2020-01-01T00:00:00+00:00&quot;) AND (external_user_allowed = &quot;true&quot;) AND (space_history_state = &quot;HISTORY_ON&quot; OR space_history_state = &quot;HISTORY_OFF&quot;) ```
  useAdminAccess: boolean, When `true`, the method runs using the user&#x27;s Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). This method currently only supports admin access, thus only `true` is accepted for this field.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response with a list of spaces corresponding to the search spaces request.
  &quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages.
  &quot;spaces&quot;: [ # A page of the requested spaces.
    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
      &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
        &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
        &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
      },
      &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
      &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
      &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
      &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
      &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
      &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
      &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
      &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
      &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
        &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
        &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
      },
      &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
      &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
        &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
          &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
          &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
          &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        },
      },
      &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
      &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
      &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
        &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
        &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
      },
      &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
      &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
      &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
      &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
      &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
      &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
    },
  ],
  &quot;totalSize&quot;: 42, # The total number of spaces that match the query, across all pages. If the result is over 10,000 spaces, this value is an estimate.
}</pre>
</div>

<div class="method">
    <code class="details" id="search_next">search_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="setup">setup(body=None, x__xgafv=None)</code>
  <pre>Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn&#x27;t be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn&#x27;t have permission to add some members, then those members aren&#x27;t added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn&#x27;t created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don&#x27;t specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren&#x27;t supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces`

Args:
  body: object, The request body.
    The object takes the form of:

{ # Request to create a space and add specified users to it.
  &quot;memberships&quot;: [ # Optional. The Google Chat users or groups to invite to join the space. Omit the calling user, as they are added automatically. The set currently allows up to 49 memberships (in addition to the caller). For human membership, the `Membership.member` field must contain a `user` with `name` populated (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user&#x27;s email as an alias for {user}. For example, the `user.name` can be `users/example@gmail.com`. To invite Gmail users or users from external Google Workspace domains, user&#x27;s email must be used for `{user}`. For Google group membership, the `Membership.group_member` field must contain a `group` with `name` populated (format `groups/{group}`). You can only add Google groups when setting `Space.spaceType` to `SPACE`. Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
    { # Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
      &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
      &quot;deleteTime&quot;: &quot;A String&quot;, # Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
      &quot;groupMember&quot;: { # A Google Group in Google Chat. # Optional. The Google Group the membership corresponds to. Reading or mutating memberships for Google Groups requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
        &quot;name&quot;: &quot;A String&quot;, # Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
      },
      &quot;member&quot;: { # A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user&#x27;s `name` and `type`. # Optional. The Google Chat user or app the membership corresponds to. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output populates the [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) `name` and `type`.
        &quot;displayName&quot;: &quot;A String&quot;, # Output only. The user&#x27;s display name.
        &quot;domainId&quot;: &quot;A String&quot;, # Unique identifier of the user&#x27;s Google Workspace domain.
        &quot;isAnonymous&quot;: True or False, # Output only. When `true`, the user is deleted or their profile is not visible.
        &quot;name&quot;: &quot;A String&quot;, # Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user&#x27;s email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
        &quot;type&quot;: &quot;A String&quot;, # User type.
      },
      &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
      &quot;role&quot;: &quot;A String&quot;, # Optional. User&#x27;s role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
      &quot;state&quot;: &quot;A String&quot;, # Output only. State of the membership.
    },
  ],
  &quot;requestId&quot;: &quot;A String&quot;, # Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.
  &quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app. # Required. The `Space.spaceType` field is required. To create a space, set `Space.spaceType` to `SPACE` and set `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. To create a group chat, set `Space.spaceType` to `GROUP_CHAT`. Don&#x27;t set `Space.displayName`. To create a 1:1 conversation between humans, set `Space.spaceType` to `DIRECT_MESSAGE` and set `Space.singleUserBotDm` to `false`. Don&#x27;t set `Space.displayName` or `Space.spaceDetails`. To create an 1:1 conversation between a human and the calling Chat app, set `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`. Don&#x27;t set `Space.displayName` or `Space.spaceDetails`. If a `DIRECT_MESSAGE` space already exists, that space is returned instead of creating a new space.
    &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
      &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
      &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    },
    &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
    &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
    &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
    &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
    &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
    &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
    &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
    &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
      &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
      &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
    },
    &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
    &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
      &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
      &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
        &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
        &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
      },
    },
    &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
    &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
      &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
      &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
    },
    &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
    &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
    &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
    &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
    &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
    &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
  &quot;accessSettings&quot;: { # Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space. # Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.
    &quot;accessState&quot;: &quot;A String&quot;, # Output only. Indicates the access state of the space.
    &quot;audience&quot;: &quot;A String&quot;, # Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  },
  &quot;adminInstalled&quot;: True or False, # Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
  &quot;createTime&quot;: &quot;A String&quot;, # Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
  &quot;customer&quot;: &quot;A String&quot;, # Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn&#x27;t populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
  &quot;displayName&quot;: &quot;A String&quot;, # Optional. The space&#x27;s display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
  &quot;externalUserAllowed&quot;: True or False, # Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
  &quot;importMode&quot;: True or False, # Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren&#x27;t visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
  &quot;importModeExpireTime&quot;: &quot;A String&quot;, # Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
  &quot;lastActiveTime&quot;: &quot;A String&quot;, # Output only. Timestamp of the last message in the space.
  &quot;membershipCount&quot;: { # Represents the count of memberships of a space, grouped into categories. # Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.
    &quot;joinedDirectHumanUserCount&quot;: 42, # Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
    &quot;joinedGroupCount&quot;: 42, # Output only. Count of all groups that have directly joined the space.
  },
  &quot;name&quot;: &quot;A String&quot;, # Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
  &quot;permissionSettings&quot;: { # [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request. # Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
    &quot;manageApps&quot;: { # Represents a space permission setting. # Optional. Setting for managing apps in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageMembersAndGroups&quot;: { # Represents a space permission setting. # Optional. Setting for managing members and groups in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;manageWebhooks&quot;: { # Represents a space permission setting. # Optional. Setting for managing webhooks in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;modifySpaceDetails&quot;: { # Represents a space permission setting. # Optional. Setting for updating space name, avatar, description and guidelines.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;postMessages&quot;: { # Represents a space permission setting. # Output only. Setting for posting messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;replyMessages&quot;: { # Represents a space permission setting. # Optional. Setting for replying to messages in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;toggleHistory&quot;: { # Represents a space permission setting. # Optional. Setting for toggling space history on and off.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
    &quot;useAtMentionAll&quot;: { # Represents a space permission setting. # Optional. Setting for using @all in a space.
      &quot;assistantManagersAllowed&quot;: True or False, # Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
      &quot;managersAllowed&quot;: True or False, # Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      &quot;membersAllowed&quot;: True or False, # Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
    },
  },
  &quot;predefinedPermissionSettings&quot;: &quot;A String&quot;, # Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  &quot;singleUserBotDm&quot;: True or False, # Optional. Whether the space is a DM between a Chat app and a single human.
  &quot;spaceDetails&quot;: { # Details about the space including description and rules. # Optional. Details about the space including description and rules.
    &quot;description&quot;: &quot;A String&quot;, # Optional. A description of the space. For example, describe the space&#x27;s discussion topic, functional purpose, or participants. Supports up to 150 characters.
    &quot;guidelines&quot;: &quot;A String&quot;, # Optional. The space&#x27;s rules, expectations, and etiquette. Supports up to 5,000 characters.
  },
  &quot;spaceHistoryState&quot;: &quot;A String&quot;, # Optional. The message history state for messages and threads in this space.
  &quot;spaceThreadingState&quot;: &quot;A String&quot;, # Output only. The threading state in the Chat space.
  &quot;spaceType&quot;: &quot;A String&quot;, # Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
  &quot;spaceUri&quot;: &quot;A String&quot;, # Output only. The URI for a user to access the space.
  &quot;threaded&quot;: True or False, # Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
  &quot;type&quot;: &quot;A String&quot;, # Output only. Deprecated: Use `space_type` instead. The type of a space.
}</pre>
</div>

</body></html>